﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class chongzhi : System.Web.UI.Page
{
    WebService.emoneybusiness service = new WebService.emoneybusiness();
    //emoneybusiness_test.emoneybusiness service = new emoneybusiness_test.emoneybusiness();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
   
    protected void btnOk_pc_Click(object sender, EventArgs e)//pc版本
    {
        string username = userName_pc.Value.Trim();
        string softpwd = softPwd_pc.Value.Trim();
        string cardid = cardId_pc.Value.Trim();
        string cardpwd = cardPwd_pc.Value.Trim();
        string c = codepc.Value.Trim();
        int cardType = 1;     //leixing 
        if (sLeve.Checked)
            cardType = int.Parse(sLeve.Value);
        else if (hLeve.Checked)
            cardType = int.Parse(hLeve.Value);
        else
            cardType = 0;
        string code = (string)Session["code"];
        if (c.Trim().ToLower() == code.Trim())
        {
            if (!service.CheckUserName(username, softpwd))
            {
                ClientScript.RegisterStartupScript(GetType(), "a", "alert('充值失败,软件用户名或密码有误');", true);
            }
            else
            {
                string result = service.DOUserAddFeeNew(username, cardType, cardid, cardpwd);
                ClientScript.RegisterStartupScript(GetType(), "a", "alert('" + result + "');", true);
                softPwd_pc.Value= "";
                cardPwd_pc.Value = "";
                codepc.Value= "";
            }
        }
        else
        {
            codepc.Value = "";
            ClientScript.RegisterStartupScript(GetType(), "a", "alert('验证码输入不正确');", true);
        }
    }
}